// Copyright  2012 Petr TALLA. [petr.talla@gmail.com]
// This file is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This file is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY;  without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
// [http://www.gnu.org/copyleft/lesser.html]
//=============================================================================

package tc.crase.meta;

import java.util.Vector;

import tc.crase.db.Xattr;
import tc.crase.sys.XobjectEx;

public class Descr {
	public Vector<DescrItem> items = new Vector<DescrItem>();
	
	String getValue(XobjectEx xobj) {
		if (items.size() == 0) return "UNDEFINED";
		
		String result = new String("");
		
		Vector<Xattr> used = new Vector<Xattr>();
		
		for (int i = 0; i < items.size(); i++) {
			DescrItem item = items.get(i);
			String resulti = item.getValue(xobj, used);
			if (resulti.equals("")) return "";
			result += resulti;
		}
		
		if ("".equals(result)) result = "UNDEFINED";
		
		return result;
	}
}
